<style>
.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th {
	padding: 5px;
	line-height:1.42857143;
	vertical-align:top;
	border-top:1px solid #ddd;
}
.closebtn {
    width: 30px;
    height: 30px;
    position: absolute;
    top: -30px;
    right: -10px;
    border-radius: 30px;
    text-align: center;
    line-height: 30px;
	font-size:24px;
    color: #fff;
}
.goods-list-table .goods-list-op .fa-edit{
    color: #5cb85c
}
.goods-list-table .goods-list-op .fa-trash-o{
    color: #d9534f
}
.goods-list-table .goods-list-num{
    font-size:12px;
	text-align:left;
}
.goods-list-table .goods-list-title{
	height:45px;
	line-height:45px;
    font-size:22px;
}
.goods-list-table .goods-list-title:hover{
	color: #f60;
}
.goods-list-table .goods-list-item {
	-webkit-border-radius: 4px;
    width: 16.66%;
	height: 96px;
    padding:0 10px 10px 0;
	float:left;
}
.goods-list-table .goods-list-item a{
	width: 100%;
    color: #fff;
    text-decoration: none;
}
.margin0 {
	margin:0px
}
/* 分割线 */
.fui-line {height: auto; display: block; position: relative; background: inherit;}
.fui-line:before {content: " "; position: absolute; top: 50%; left: 0; width: 100%; height: 1px; background: #d5d5d5;}
.text {height: 100%; width: auto; margin: 5px; background: inherit; font-size: 18px; display: table; position: relative;}
.text.big { font-size:0.8rem}
.text.large { font-size:1rem}
.yuyue-duan {border: 1px solid #19b955;border-radius: 4px;padding:0.1rem;height:auto;width:90px;margin:8px;font-size:12px;text-align:center}
.yuyue-duan span {width:100%;text-align:center}
.timeischack{background:#19b955;color:#fff}
.clear{clear:both;}
.fui-footer.quick {
    background: #474749;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    z-index: 30;
}
.fui-footer.quick .quick-cart {
    width: 3.6rem;
    position: relative;
}
.fui-footer.quick .quick-cart.an {
    animation: cartan 0.5s;
}
.fui-footer.quick .quick-info {
    width: 100%;
    padding: 0.3rem 0.4rem;
    line-height: 0.8rem;
    font-size: 12px;
    color: #fff;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
}
.fui-footer.quick .quick-info .price {
    font-size: 16px;
    line-height: 16px;
}
.fui-footer.quick .quick-submit {
	min-width:140px;
	text-align:center;
    height: 50px;
    padding: 0 1.2rem;
    line-height: 2.5rem;
    background: #ff9d55;
    color: #fff;
    display: inline-block;
}
.fui-footer.quick .quick-submit.disabled {
    background: #5c5c5f;
}
/* 数量选择器 */
.quick-num {
    height: 22px;
    width: auto;
    display: -webkit-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
}
.quick-num.open .minus {
    -moz-transition-duration: 300ms;
    -webkit-transition-duration: 300ms;
    transition-duration: 300ms;
    -webkit-transform: translate3d(0, 0, 0) rotate(0deg);
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 1;
}
.quick-num.open .num {
    -moz-transition-duration: 300ms;
    -webkit-transition-duration: 300ms;
    transition-duration: 300ms;
    opacity: 1;
}
.quick-num.close .minus {
    animation: closeminus 0.2s;
    animation-fill-mode : forwards;
}
.quick-num.close .num {
    -moz-transition-duration: 100ms;
    -webkit-transition-duration: 100ms;
    transition-duration: 100ms;
    opacity: 0;
}
.quick-num .minus,
.quick-num .plus {
    height: 24px;
    width: 24px;
    line-height: 22px;
    font-size: 24px;
    text-align: center;
    border-radius: 100%;
}
.quick-num .minus {
    color: #ff5555;
    border: 1px solid #ff5555;
    -webkit-transform: translate3d(200%, 0, 0) rotate(90deg);
    transform: translate3d(200%, 0, 0) rotate(90deg);
    -webkit-transition-property: -webkit-transform;
    transition-property: transform;
    background: #fff;
    opacity: 0;
    position: relative;
    z-index: 8;
}
.quick-num .minus.disabled {
    color: #dadada;
    border-color: #dadada;
}
.quick-num .plus {
    background: #ff5555;
    color: #fff;
    position: relative;
    z-index: 11;
}
.quick-num .plus.disabled {
    background: #dadada;
}
.quick-num .num {
    height: 24px;
    line-height: 24px;
    font-size: 17px;
    min-width: 24px;
    padding: 0 4px;
    text-align: center;
    color: #777;
    opacity: 0;
}
</style>
<div class="panel-body">
		<ul class="nav nav-tabs" ng-if="pagedata.groups">
			<li ng-class="{'active':pagedata.params.pcate==0}"><a href="javascript:;" ng-click="access_json('main','pcate=0')">全部</a></li>
			<li ng-repeat="tab in pagedata.groups" ng-class="{'active':pagedata.params.pcate==tab.id}"><a href="javascript:;" ng-click="access_json('main','pcate='+tab.id)">{{tab.title}}</a></li>
		</ul>
		<div class="col-lg-8">
        <div class="panel panel-default">
            <div class="panel-heading">
                请选择商品
            </div>
            <div class="table-responsive panel-body">
                    <div class="goods-list-table">
                        <div class="goods-list-item" ng-repeat="item in pagedata.list">
                            <div style="background-color:#28B5D6;padding:5px" ng-show="item.isoption !=1">
								<a href="javascript:" ng-click="addfoot(item.id,item);" id="dishid_{{item.id}}" dishid="{{item.id}}">
									<div class="goods-list-num">{{item.id}}</div>
									<div class="goods-list-title" style="overflow: hidden;">
										<span>{{item.title}}</span>
									</div>
									<div class="goods-list-price" style="overflow: hidden;">
										<span class="l">￥{{item.price}}</span>
										<span class="r"><i class="fa fa-plus"></i></span>
									</div>
								</a>
							</div>
							<div style="background-color:#28B5D6;padding:5px" ng-show="item.isoption ==1">
							<a href="javascript:" onclick="$('#selecttaocan').modal();" ng-click="pagedata.goodsid=item.id;">
								<div class="goods-list-num">{{item.id}}</div>
								<div class="goods-list-title" style="overflow: hidden;">
									<span>{{item.title}}</span>
								</div>
								<div class="goods-list-price" style="overflow: hidden;">
									<span class="l">￥{{item.price}}</span>
									<span  class="r">选规格</span>
								</div>
                            </a>
							</div>
                        </div>
                        <div class="space"></div>
                    </div>
					<div class="page" style="margin-left:0;">
						<!-- 分页导航 -->
							<div ng-include="sys_html('common/page',true)"></div>
					</div>
            </div>
        </div>
		
    </div>
	<div class="col-lg-4">
        <style>
            .i-add-btn{
                width:20px;  line-height:20px; text-align:center; border-radius:10px;  font-size:10px;
                background-color:#FE4F4E;
                color: #fff;
            }
            .i-remove-btn{
                border: 1px solid #a7a2a9; width:20px;   line-height:20px; text-align:center;
                border-radius:10px; font-size:10px
            }
        </style>
        <div class="panel panel-default" style="width: 100%;">
			<div class="panel-body">
			<div class="form-group">
                        <div class="col-sm-12">
							<div class="input-group">
                            <input type="text" name="productsn" ng-change="pagedata.getgoods()" ng-model="pagedata.productsn" class="form-control" placeholder="请扫描或输入国家商品条码"/>
							<div class="input-group-btn">
                                     <input type="button" value="查询" class="btn" ng-click="pagedata.getgoods()"/>
                             </div>
							</div>
                        </div>
             </div>
			 </div>
            <div class="panel-heading">
                订单信息 <a class="btn btn-warning btn-sm clear-btn" href="javascript:" ng-click="unsetcarts();">清空购物车</a>
            </div>
            <div class="table-responsive panel-body">
                <div class="table table-hover text-center" id="native-scroll" style="min-width:100%;">
                    <div class="row" style="margin:5px;font-size:16px;color:#f60"><span class="col-sm-5">商品名称</span><span class="col-sm-2">数量</span><span class="col-sm-2">单价</span><span class="col-sm-3">操作</span></div>
					<div class="row" ng-repeat="(key,item) in pagedata.carts">
						<div class="row margin0" style="padding:10px 0;border-bottom: 1px solid #d9d9d9" ng-if="!item.options">
						<div class="col-sm-5">{{item.title}}</div>
						<div class="col-sm-2 total">{{item.num}}</div>
						<div class="col-sm-2">¥<font>{{item.price}}</font></div>
						<div class="col-sm-3"><a href="javascript:" ng-click="plusup2(key,-1);"><i class="i-add-btn fa fa-plus" ></i></a> {{item.num}} <a href="javascript:" ng-click="minusup2(key,-1);"><i class="i-remove-btn fa fa-minus"></i></a></div>
						</div>
						<div class="row margin0" style="padding:10px 0;border-bottom: 1px solid #d9d9d9" ng-repeat="(k,v) in item.options" ng-if="v.num>0">
						<div class="col-sm-5">{{item.title}}-[{{v.title}}]</div>
						<div class="col-sm-2 total">{{v.num}}</div>
						<div class="col-sm-2">¥<font>{{v.price}}</font></div>
						<div class="col-sm-3"><a href="javascript:" ng-click="plusup2(key,k);"><i class="i-add-btn fa fa-plus" ></i></a> {{v.num}} <a href="javascript:" ng-click="minusup2(key,k);"><i class="i-remove-btn fa fa-minus"></i></a></div>
						</div>
					</div>
                </div>
            </div>
            <div class="panel-footer">
                <h5>商品价格:<strong class="text-danger" id="goodsprice">{{pagedata.allprice}}</strong></h5>
            </div>
        </div>
        <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data" id="form1">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="row-fluid">
                        <div class="span3 control-group">
                            用户信息
                        </div>
                    </div>
                </div>
                <div class="panel-body">
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 col-lg-3 control-label">订单类型</label>
                        <div class="col-sm-10 col-lg-9">
                            <select class="form-control" ng-model="pagedata.post.sendtype">
                                <option ng-selected="pagedata.post.sendtype==2" value="2" >自提/店内</option>
								<option ng-selected="pagedata.post.sendtype==1" value="1" >快递配送</option>
								<option ng-selected="pagedata.post.sendtype==3" value="3" >虚拟商品</option>
							</select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 col-lg-3 control-label">支付方式</label>
                        <div class="col-sm-10 col-lg-9">
                            <select class="form-control" name="paytype" id="paytype" ng-model="pagedata.post.paytype" autocomplete="off">
                                <option ng-selected="pagedata.post.paytype==0" value="0" >现金付款</option>
                                <option ng-selected="pagedata.post.paytype==1" value="1" >pos刷卡</option>
                                <option ng-selected="pagedata.post.paytype==2" value="2" >挂帐</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 col-lg-3 control-label">支付状态</label>
                        <div class="col-sm-10 col-lg-9">
                            <select class="form-control" name="is_pay" id="is_pay" ng-model="pagedata.post.is_pay" autocomplete="off">
                                <option ng-selected="pagedata.post.is_pay==0" value="0" >未支付</option>
                                <option ng-selected="pagedata.post.is_pay==1" value="1" >已支付</option>
                            </select>
                        </div>
                    </div>
					<div class="form-group">
						<label class="col-xs-12 col-sm-2 col-md-2 col-lg-3 control-label">选择会员</label>
						<div class="col-xs-12 col-sm-8 col-lg-9">
							<div class="input-group">
								<input type="text" class="form-control" placeholder="选择会员" readonly ng-model="pagedata.post.mid" />
								<span class="input-group-btn">
									<button class="btn btn-primary" type="button" ng-click="modal_func(pagedata.post,'mid','core/member.get_member/')"><i class="fa fa-external-link"></i>选择会员</button>
								</span>
							</div>
							<div class="help-block">如果有的话,选择会员</div>
						</div>
					</div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-2 col-md-2 col-lg-3 control-label">
                            用户名</label>
                        <div class="col-sm-10 col-lg-9">
                            <input type="text" name="username" ng-model="pagedata.post.username" class="form-control" value="" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-2 col-md-2 col-lg-3 control-label">
                            手机号码</label>
                        <div class="col-sm-10 col-lg-9">
                            <input type="text" name="mobile" ng-model="pagedata.post.mobile" class="form-control" value="" />
                        </div>
                    </div>
                    <div class="form-group" ng-if="pagedata.post.sendtype==1">
                        <label class="col-xs-12 col-sm-2 col-md-2 col-lg-3 control-label">
                            配送地址</label>
                        <div class="col-sm-10 col-lg-9">
                            <input type="text" name="address" ng-model="pagedata.post.address" class="form-control" value="" />
                        </div>
                    </div>
					<div class="form-group" ng-if="pagedata.post.sendtype==1">
						<label class="col-xs-12 col-sm-2 col-md-2 col-lg-3 control-label">配送时间</label>
						<div class="col-sm-10 col-lg-9"><input type="text" name="deliverytime" onchange="window.scope.pagedata.post.deliverytime=$(this).val()" ng-model="pagedata.post.deliverytime" placeholder="请选择日期时间" readonly="readonly" class="datetimepicker form-control" style="padding-left:12px;" /></div>
						<script type="text/javascript">
							require(["datetimepicker"], function(){
								$(function(){
									var option = {
											lang : "zh",
											step : 5,
											timepicker : true,
											closeOnDateSelect : true,
											format : "Y-m-d H:i"
									};
									$(".datetimepicker[name = 'deliverytime']").datetimepicker(option);
								});
							});
						</script>
					</div>
                    <div class="form-group" ng-if="pagedata.order_type==1">
                        <label class="col-xs-12 col-sm-2 col-md-2 col-lg-3 control-label">
                            人数</label>
                        <div class="col-sm-10 col-lg-9">
                            <a href="javascript:" ng-click="plususer_num();"><i class="i-add-btn fa fa-plus" ></i></a> {{pagedata.post.user_num}} <a href="javascript:" ng-click="minsuser_num();"><i class="i-remove-btn fa fa-minus"></i></a>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-2 col-md-2 col-lg-3 control-label">
                            备注</label>
                        <div class="col-sm-10 col-lg-9">
                            <textarea name="remark" id="remark" style="height:80px;" ng-model="pagedata.post.remark" class="form-control">{{pagedata.post.remark}}</textarea>
                        </div>
                    </div>
                </div>
                <div class="panel-footer">
                    <h5 id="totalprice">订单总价:<strong class="text-danger">{{pagedata.orderprice}}</strong></h5>
                </div>
            </div>
        </form>
        <div class="form-group col-sm-11" style="padding-left: 0px;">
            <a  class="btn btn-primary col-lg-8" href="javascript:;" ng-click="post(pagedata.post,'addorder')">提交订单</a>
        </div>

    </div>
</div>
	<div id="selecttaocan" class="modal fade" tabindex="-1" style="z-index: 99999; display: none;">
					<div class="modal-dialog">
						<div class="modal-content" style="border-radius: 4px;">
								<div aria-hidden="true" data-dismiss="modal" class="closebtn"><i class="fa fa-times-circle-o"></i></div>				
								<div class="text text-danger">{{pagedata.list[pagedata.goodsid].title}}</div>
								<div class="row margin0">
									<div ng-repeat="(k,spec) in pagedata.list[pagedata.goodsid].specs_list" class="option-picker-cell option spec" style="padding:10px">
										<h5 class="title">{{spec.title}}</h5>
										<div class="select">
											 <a ng-repeat="item in spec.items" href="javascript:;" ng-click="pagedata.get_optionsid(k,item.id);" ng-class="{'btn btn-gray btn-sm spec-item':1,'btn-default':pagedata.carts[pagedata.goodsid].specid[k]==item.id}" style="margin-right:5px;margin-bottom:5px"> {{item.title}} </a>
										</div>
									</div>
								</div>
								<div class="row margin0" style="padding-top:16px">
									<div class="fui-footer quick" style="height:42px;">
											<div class="quick-info" style="background:#ff5555;height:42px">
												<p class="price" style="font-size:0.8rem;line-height:30px">￥{{pagedata.list[pagedata.goodsid].options.price || '0.00'}}/份</p>
											</div>
											<a ng-show="pagedata.carts[pagedata.goodsid].options[pagedata.list[pagedata.goodsid].options.id].num==0" class="quick-submit" style="height:42px;margin: 0;font-size:0.65rem;line-height:42px" href="javascript:;" ng-click="plusup();">加入购物车</a>
											<div ng-show="pagedata.carts[pagedata.goodsid].options[pagedata.list[pagedata.goodsid].options.id].num>0"class="quick-submit" style="height:42px;margin: 0;font-size:0.8rem;line-height:42px;">
												<div class="quick-num open" style="margin-top:10px">
													<div ng-click="minusup();" class="minus fa fa-minus" style="background: none; color: #fff; border: 1px solid #fff;font-size: 16px;"></div>
													<div class="num" style="color:#fff">{{pagedata.carts[pagedata.goodsid].options[pagedata.list[pagedata.goodsid].options.id].num}}</div>
													<div ng-click="plusup();" class="plus fa fa-plus" style="background: none;border: 1px solid #fff;font-size: 16px;"></div>
												</div>
											</div>
									</div>
								</div>
								<div class="clear"></div>
						</div>
					</div>
	</div>
<script type="text/javascript">
scope.pagedata.carts={}
scope.pagedata.selected = 0;  //状态标记
scope.pagedata.post.user_num = 2;
scope.pagedata.orderprice += scope.pagedata.in_pay*2
var usernums=[];
for($i = 1;$i<21;$i++){
	usernums[$i] = $i;
}
scope.pagedata.usernums =usernums;
scope.minsuser_num = function(){
	scope.pagedata.post.user_num -= 1;
	scope.pagedata.orderprice -= parseInt(scope.pagedata.in_pay)
}
scope.plususer_num = function(){
	scope.pagedata.post.user_num += 1;
	scope.pagedata.orderprice += parseInt(scope.pagedata.in_pay)
}
scope.update=function(goodsid,num,optionsid){
	scope.pagedata.post.carts=scope.pagedata.carts;
	/*var params={
		data:{'num':num,'goodsid':goodsid,'optionsid':optionsid},
		op:'diancai',
		callback:function(res){
			if(res.options.id){
				
				scope.$evalAsync();
			}
			
		}
	};
	scope.post_json(params);*/
}
scope.minusup2 = function(goodsid,optionsid){
		console.log(goodsid);
		console.log(optionsid);
		if(optionsid !=-1){
			if(scope.pagedata.carts[goodsid].options[optionsid].num <2){
				delete scope.pagedata.carts[goodsid]
				return false
			}else{
				scope.pagedata.carts[goodsid].options[optionsid].num --
				var num = scope.pagedata.carts[goodsid].options[optionsid].num
			}
			var price = scope.pagedata.list[goodsid].options.price
			
		}else{
			if(scope.pagedata.carts[goodsid].num <2){
				delete scope.pagedata.carts[goodsid]
			}else{
				scope.pagedata.carts[goodsid].num --
				var num = scope.pagedata.carts[goodsid].num
			}
			var price = scope.pagedata.list[goodsid].price
			
		}
		scope.update();
		scope.pagedata.allprice -= parseInt(price);
		scope.pagedata.orderprice = scope.pagedata.allprice + scope.pagedata.in_pay*scope.pagedata.post.user_num;
}
scope.plusup2 = function(goodsid,optionsid){
		if(optionsid !=-1){
			scope.pagedata.carts[goodsid].options[optionsid].num ++
			var price = scope.pagedata.list[goodsid].options.price
		}else{
			scope.pagedata.carts[goodsid].num ++
			var price = scope.pagedata.list[goodsid].price
		}
		scope.update();
		scope.pagedata.allprice += parseInt(price);
		scope.pagedata.orderprice = scope.pagedata.allprice + scope.pagedata.in_pay*scope.pagedata.post.user_num;
}
scope.minusup = function(){
		var goodsid =scope.pagedata.goodsid;
		var optionsid = scope.pagedata.list[goodsid].options.id
		if(scope.pagedata.carts[goodsid].options[optionsid].num <=1){
			delete scope.pagedata.carts[goodsid]
		}else{
			scope.pagedata.carts[goodsid].options[optionsid].num --
			var num = scope.pagedata.carts[goodsid].options[optionsid].num
		}
		var price = scope.pagedata.list[goodsid].options.price
		scope.pagedata.allprice -= parseInt(price);
		scope.pagedata.orderprice = scope.pagedata.allprice + scope.pagedata.in_pay*scope.pagedata.post.user_num;
}
scope.plusup = function(){
		var goodsid =scope.pagedata.goodsid;
		var optionsid = scope.pagedata.list[goodsid].options.id
		scope.pagedata.carts[goodsid].options[optionsid].num ++
		var num = scope.pagedata.carts[goodsid].options[optionsid].num
		var price = scope.pagedata.list[goodsid].options.price
		console.log('scope.pagedata.carts');console.log(scope.pagedata.carts);
		scope.update();
		scope.pagedata.allprice += parseInt(price);
		scope.pagedata.orderprice = scope.pagedata.allprice + scope.pagedata.in_pay*scope.pagedata.post.user_num;
}
//选择
scope.pagedata.get_optionsid=function(k,sid){
	var goodsid = scope.pagedata.goodsid;
	console.log('goodsid');console.log(goodsid);
	scope.pagedata.carts[goodsid]=scope.pagedata.carts[goodsid]?scope.pagedata.carts[goodsid]:{}
	scope.pagedata.carts[goodsid].specid=scope.pagedata.carts[goodsid].specid?scope.pagedata.carts[goodsid].specid:[]
	scope.pagedata.carts[goodsid].options=scope.pagedata.carts[goodsid].options?scope.pagedata.carts[goodsid].options:{};
	scope.pagedata.carts[goodsid].specid[k]=sid;
	console.log('carts');console.log(scope.pagedata.carts);
	var specid = scope.pagedata.carts[goodsid].specid;
		console.log('specid');console.log(specid);
		specid = specid.join('_');
	var params={
		data:{'specid':specid,'goodsid':goodsid},
		op:'get_optionsid',
		callback:function(res){
			if(res.options.id){
				console.log('res.options');console.log(res.options);
				scope.pagedata.carts[goodsid].title=scope.pagedata.list[goodsid].title
				scope.pagedata.carts[goodsid].options[res.options.id]=scope.pagedata.carts[goodsid].options[res.options.id]?scope.pagedata.carts[goodsid].options[res.options.id]:res.options
				scope.pagedata.carts[goodsid].options[res.options.id].id=res.options.id;
				scope.pagedata.carts[goodsid].options[res.options.id].num=scope.pagedata.carts[goodsid].options[res.options.id].num?scope.pagedata.carts[goodsid].options[res.options.id].num:0;
				scope.pagedata.list[goodsid].options=res.options;
				scope.$evalAsync();
			}
			
		}
	};
	scope.post_json(params);
}
scope.addfoot = function(goodsid,goods){
		scope.pagedata.carts[goodsid]=scope.pagedata.carts[goodsid]?scope.pagedata.carts[goodsid]:{}
		scope.pagedata.carts[goodsid].num=scope.pagedata.carts[goodsid].num?scope.pagedata.carts[goodsid].num:0
		scope.pagedata.carts[goodsid].num ++
		if(goods){
			scope.pagedata.carts[goodsid].title=goods.title
			scope.pagedata.carts[goodsid].price=goods.price
			var price = goods.price
		}else{
			scope.pagedata.carts[goodsid].title=scope.pagedata.list[goodsid].title
			scope.pagedata.carts[goodsid].price=scope.pagedata.list[goodsid].price
			var price = scope.pagedata.list[goodsid].price
		}
		console.log('scope.pagedata.carts');console.log(scope.pagedata.carts);
		scope.update();
		scope.pagedata.allprice += parseInt(price);
		scope.pagedata.orderprice = scope.pagedata.allprice + scope.pagedata.in_pay*scope.pagedata.post.user_num;
		scope.$evalAsync();
}
scope.pagedata.getgoods=function(){
		if(!scope.pagedata.productsn){
			scope.message('请输入国家商品条码！');
			return false;
		}
		scope.get('jy_weishop/get_data/getgoods/productsn='+scope.pagedata.productsn,function(res){
			if(!res.goods || !res.goods.id){
				scope.msg('没找到该商品！');
				return false;
			}
			scope.addfoot(res.goods.id,res.goods)
			scope.pagedata.productsn=''
			scope.$evalAsync();
		});
}
scope.unsetcarts = function(){
	scope.pagedata.carts={}
}

</script>